import 'package:get/get.dart';
import 'package:sainbainu/common/middlewares/auth_middleware.dart';
import 'package:sainbainu/common/middlewares/bind_mobile_middleware.dart';
import 'package:sainbainu/common/middlewares/real_name_middleware.dart';
import 'package:sainbainu/common/routes/routes.dart';
import 'package:sainbainu/view/about_we/index.dart';
import 'package:sainbainu/view/account_security/index.dart';
import 'package:sainbainu/view/bind_mobile/index.dart';
import 'package:sainbainu/view/bind_third_party/index.dart';
import 'package:sainbainu/view/content_create/index.dart';
import 'package:sainbainu/view/content_detail/index.dart';
import 'package:sainbainu/view/fans/index.dart';
import 'package:sainbainu/view/feedback/index.dart';
import 'package:sainbainu/view/follow/index.dart';
import 'package:sainbainu/view/global_search/index.dart';
import 'package:sainbainu/view/group_create_update/index.dart';
import 'package:sainbainu/view/group_detail/index.dart';
import 'package:sainbainu/view/group_list/index.dart';
import 'package:sainbainu/view/group_member/index.dart';
import 'package:sainbainu/view/my_groups/index.dart';
import 'package:sainbainu/view/language/index.dart';
import 'package:sainbainu/view/layout/index.dart';
import 'package:sainbainu/view/live_record/index.dart';
import 'package:sainbainu/view/login/index.dart';
import 'package:sainbainu/view/notice/index.dart';
import 'package:sainbainu/view/official_auth/index.dart';
import 'package:sainbainu/view/password_change/index.dart';
import 'package:sainbainu/view/privacy_agree/index.dart';
import 'package:sainbainu/view/real_name_auth/index.dart';
import 'package:sainbainu/view/settings/index.dart';
import 'package:sainbainu/view/unknown/view.dart';
import 'package:sainbainu/view/user_agree/index.dart';
import 'package:sainbainu/view/user_detail/index.dart';
import 'package:sainbainu/view/user_detail/view.dart';
import 'package:sainbainu/view/user_info/index.dart';
import 'package:sainbainu/view/version/index.dart';
import 'package:sainbainu/view/wallet/index.dart';
import 'package:sainbainu/view/webview/index.dart';
import 'package:sainbainu/view/welcome/index.dart';

class AppRouter {
  /// 未定义路由
  static final GetPage unknownPage = GetPage(
    name: AppRoutes.unknown,
    page: () => const UnknownPage(),
  );

  /// 路由页面
  static final List<GetPage> getPages = [
    GetPage(
      name: AppRoutes.welcome,
      page: () => const WelcomePage(),
      binding: WelcomeBinding(),
    ),
    GetPage(
      name: AppRoutes.layout,
      page: () => const LayoutPage(),
      binding: LayoutBinding(),
    ),
    GetPage(
      name: AppRoutes.contentDetail,
      page: () => const ContentDetailPage(),
      binding: ContentDetailBinding(),
    ),
    GetPage(
      name: AppRoutes.contentCreate,
      page: () => const ContentCreatePage(),
      binding: ContentCreateBinding(),
      fullscreenDialog: true,
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.settings,
      page: () => const SettingsPage(),
      binding: SettingsBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.login,
      page: () => const LoginPage(),
      binding: LoginBinding(),
      fullscreenDialog: true,
    ),
    GetPage(
      name: AppRoutes.wallet,
      page: () => const WalletPage(),
      binding: WalletBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.liveRecord,
      page: () => const LiveRecordPage(),
      binding: LiveRecordBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.userAgree,
      page: () => const UserAgreePage(),
      binding: UserAgreeBinding(),
    ),
    GetPage(
      name: AppRoutes.privacyAgree,
      page: () => const PrivacyAgreePage(),
      binding: PrivacyAgreeBinding(),
    ),
    GetPage(
      name: AppRoutes.aboutWe,
      page: () => const AboutWePage(),
      binding: AboutWeBinding(),
    ),
    GetPage(
      name: AppRoutes.userInfo,
      page: () => const UserInfoPage(),
      binding: UserInfoBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.language,
      page: () => const LanguagePage(),
      binding: LanguageBinding(),
      fullscreenDialog: true,
    ),
    GetPage(
      name: AppRoutes.version,
      page: () => const VersionPage(),
      binding: VersionBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.accountSecurity,
      page: () => const AccountSecurityPage(),
      binding: AccountSecurityBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.bindMobile,
      page: () => const BindMobilePage(),
      binding: BindMobileBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.passwordChange,
      page: () => const PasswordChangePage(),
      binding: PasswordChangeBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.bindThirdParty,
      page: () => const BindThirdPartyPage(),
      binding: BindThirdPartyBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.realNameAuth,
      page: () => const RealNameAuthPage(),
      binding: RealNameAuthBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.officialAuth,
      page: () => const OfficialAuthPage(),
      binding: OfficialAuthBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.myGroups,
      page: () => const MyGroupsPage(),
      binding: MyGroupsBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.groupCreateUpdate,
      page: () => const GroupCreateUpdatePage(),
      binding: GroupCreateUpdateBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.groupDetail,
      page: () => const GroupDetailPage(),
      binding: GroupDetailBinding(),
    ),
    GetPage(
      name: AppRoutes.groupMember,
      page: () => const GroupMemberPage(),
      binding: GroupMemberBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.feedback,
      page: () => const FeedbackPage(),
      binding: FeedbackBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.follow,
      page: () => const FollowPage(),
      binding: FollowBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.fans,
      page: () => const FansPage(),
      binding: FansBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.globalSearch,
      page: () => const GlobalSearchPage(),
      binding: GlobalSearchBinding(),
      fullscreenDialog: true,
      transition: Transition.fadeIn,
    ),
    GetPage(
      name: AppRoutes.notice,
      page: () => const NoticePage(),
      binding: NoticeBinding(),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(
      name: AppRoutes.groupList,
      page: () => const GroupListPage(),
      binding: GroupListBinding(),
    ),
    GetPage(
      name: AppRoutes.webview,
      page: () => const WebviewPage(),
      binding: WebviewBinding(),
    ),
    GetPage(
      name: AppRoutes.userDetail,
      page: () => const UserDetailPage(),
      binding: UserDetailBinding(),
    ),
  ];
}
